<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Models_Products</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class Models_Products</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Products model</p>
	<ul class="tags">
				<li><span class="field">license:</span> New</li>
				<li><span class="field">copyright:</span> Copyright (c) 2009 Konstantin Shamko</li>
				<li><span class="field">version:</span> 0.0.1</li>
				<li><span class="field">author:</span> Konstantin Shamko &lt;<a href="mailto:konstantin.shamko@gmail.com">konstantin.shamko@gmail.com</a>&gt;</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_Models_Products_php.html">/Models/Products.php</a> (line <span class="field">12</span>)
		</p>
		
				
		<pre>Bel_Model_Abstract
   |
   --Models_Products</pre>
	
			</div>
</div>



	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
								<div class="var-title">
					<span class="var-type">array</span>
					<a href="#$_dependentTables" title="details" class="var-name">$_dependentTables</a>
				</div>
								<div class="var-title">
					<span class="var-type">array</span>
					<a href="#$_referenceMap" title="details" class="var-name">$_referenceMap</a>
				</div>
							</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">int</span>
										<a href="#addEntry" title="details" class="method-name">addEntry</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$data_to_add</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#getEntryById" title="details" class="method-name">getEntryById</a>
											(<span class="var-type">int</span>&nbsp;<span class="var-name">$id</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#getFullProductInfo" title="details" class="method-name">getFullProductInfo</a>
											(<span class="var-type">int</span>&nbsp;<span class="var-name">$product_id</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#getProductsByCategory" title="details" class="method-name">getProductsByCategory</a>
											(<span class="var-type">int</span>&nbsp;<span class="var-name">$cat_id</span>, [<span class="var-type">array||string</span>&nbsp;<span class="var-name">$order</span> = <span class="var-default">null</span>], [<span class="var-type">int</span>&nbsp;<span class="var-name">$page</span> = <span class="var-default">1</span>])
									</div>
								
				<div class="method-definition">
											<span class="method-result">int</span>
										<a href="#updateEntry" title="details" class="method-name">updateEntry</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$data_to_update</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">Zend_Db_Select</span>
										<a href="#_selectQuery" title="details" class="method-name">_selectQuery</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">Zend_Db_Select</span>
										<a href="#_selectQueryByCategory" title="details" class="method-name">_selectQueryByCategory</a>
										()
									</div>
							</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="var$_dependentTables" id="$_dependentTables"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">array</span>
			<span class="var-name">$_dependentTables</span>
			 = <span class="var-default">array('Models_Products_Images','Models_Products_AttributeValues','Models_Products_Categories')</span>			(line <span class="line-number">19</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Array of tables' classes which are in one-to-many relation with products table.</p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
<a name="var$_referenceMap" id="$_referenceMap"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">array</span>
			<span class="var-name">$_referenceMap</span>
			 = <span class="var-default">array (<br />								'Template' =&gt; array (<br />									'columns' =&gt; 'product_template_id',<br />									'refTableClass' =&gt; 'Models_ProductTemplates',<br />									'refColumns' =&gt; 'product_template_id', <br />									'onDelete' =&gt; self::CASCADE	))</span>			(line <span class="line-number">26</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Describes many-to-one relation between products and products' templates</p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
																	<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">Constructor __construct</span> (line <span class="line-number">39</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets products table name and primary key</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			__construct
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodaddEntry" id="addEntry"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">addEntry</span> (line <span class="line-number">51</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Adds product and its attributes values</p>
	<ul class="tags">
				<li><span class="field">return:</span> - last inserted entry primary key</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			addEntry
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$data_to_add</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$data_to_add</span><span class="var-description">: - associative array (key - name of a table field, value - field value)</span>			</li>
				</ul>
		
		
	</div>
<a name="methodgetEntryById" id="getEntryById"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getEntryById</span> (line <span class="line-number">66</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns product and its attributes values by id</p>
	<ul class="tags">
				<li><span class="field">return:</span> - product data</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			getEntryById
		</span>
					(<span class="var-type">int</span>&nbsp;<span class="var-name">$id</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$id</span><span class="var-description">: - product id value</span>			</li>
				</ul>
		
		
	</div>
<a name="methodgetFullProductInfo" id="getFullProductInfo"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getFullProductInfo</span> (line <span class="line-number">90</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns full product (product date, product attributes' values, product images, product categories)</p>
	<ul class="tags">
				<li><span class="field">return:</span> - full product info</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			getFullProductInfo
		</span>
					(<span class="var-type">int</span>&nbsp;<span class="var-name">$product_id</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$product_id</span>			</li>
				</ul>
		
		
	</div>
<a name="methodgetProductsByCategory" id="getProductsByCategory"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getProductsByCategory</span> (line <span class="line-number">125</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns product by categories. Return data contains general product info (with no attributes) and images info</p>
	<ul class="tags">
				<li><span class="field">return:</span> - array of stdObjects</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			getProductsByCategory
		</span>
					(<span class="var-type">int</span>&nbsp;<span class="var-name">$cat_id</span>, [<span class="var-type">array||string</span>&nbsp;<span class="var-name">$order</span> = <span class="var-default">null</span>], [<span class="var-type">int</span>&nbsp;<span class="var-name">$page</span> = <span class="var-default">1</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$cat_id</span><span class="var-description">: - category id</span>			</li>
					<li>
				<span class="var-type">array||string</span>
				<span class="var-name">$order</span><span class="var-description">: - sort params</span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$page</span><span class="var-description">: - number of page to select</span>			</li>
				</ul>
		
		
	</div>
<a name="methodupdateEntry" id="updateEntry"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">updateEntry</span> (line <span class="line-number">110</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Updates product and its attributes values</p>
	<ul class="tags">
				<li><span class="field">return:</span> - number of affected rows</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			updateEntry
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$data_to_update</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$data_to_update</span><span class="var-description">: - associative array (key - name of a table field, value - field value)</span>			</li>
				</ul>
		
		
	</div>
<a name="method_selectQuery" id="_selectQuery"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">_selectQuery</span> (line <span class="line-number">152</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Prepares select query for getAll method. This select will return products with templates</p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Zend_Db_Select</span>
		<span class="method-name">
			_selectQuery
		</span>
				()
			</div>
	
		
		
	</div>
<a name="method_selectQueryByCategory" id="_selectQueryByCategory"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">_selectQueryByCategory</span> (line <span class="line-number">135</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Prepares select query for getAll method. This select will return products with images</p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Zend_Db_Select</span>
		<span class="method-name">
			_selectQueryByCategory
		</span>
				()
			</div>
	
		
		
	</div>
						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Mon, 01 Mar 2010 23:32:29 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0RC3</a>
	</p>
	</div></body>
</html>